<template>
  <div>
    <button @click="toNewsItem('3:0 JDG vs REG','01')">3:0 JDG vs REG</button>
    <button @click="toNewsItem('二十大召开','02')">二十大召开</button>
    <button @click="toNewsItem('希望面试成功','03')">希望面试成功</button>
    <router-view></router-view>
  </div>
</template>

<script lang="ts">
import {defineComponent} from "vue";
export default defineComponent({
    name:"News",
})
</script>

<script lang="ts" setup>
import {useRouter} from "vue-router";
const router = useRouter()
const toNewsItem = (title:string,id:string)=>{
    router.push({
        name:"newsItem",
        query:{
            title,
            id
        }
    })
}
</script>

<style scoped>

</style>